<?php
$meta = array(  array('name' => 'robots',       'content' => 'no-cache'),
                array('name' => 'description',  'content' => 'Captain Cock'),
                array('name' => 'keywords',     'content' => 'love, passion, intrigue, deception'),
                array('name' => 'Content-type', 'content' => 'text/html; charset=utf-8', 'type' => 'equiv'),
                array('name' => 'viewport',     'content' => '"width=device-width, initial-scale=1'),       #ensures proper rendering and touch zooming
             );

echo doctype('html5');                                                          #html5 doctype
echo meta($meta);                                                               #publishes meta information specified above
echo link_tag('css/bootstrap.css');                                             #include twitter bootstrap css
echo link_tag('css/cpt_css.css');                                               #include custom css
echo link_tag('img/favicon.ico', 'shortcut icon', 'image/ico');                 #the page favicon
echo '<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>';          #jquery lib
echo '<script src="' . base_url() . 'js/bootstrap.js"></script>';               #bootstrap custom java script
echo '<script src="' . base_url() . 'js/holder.js"></script>';                  #holder library to display client side image containers
?>

<body>
    <div class="container">
        <div class="row">
            
            <!-- The page header, mainly the navigation bar -->
            <div class="col-md-12" id="header">
                <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation" id="navbar">
                    <div class="container-fluid">
                        <div class="navbar-header">       
                            <!-- Appears on low-res only -->
                            <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                                <span class="icon-bar"></span>
                            </button>
                            <a class="navbar-brand" href="#">Cpt Cock</a>
                        </div>
                        
                        <!-- Navbar menu entries -->
                        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                            <ul class="nav navbar-nav">
                                <li class="active"><a href="<?php echo base_url(); ?>">Home</a></li>
                                
                                <!-- Drink dropdown -->
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Drinks <b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                        <li><a href="<?php echo base_url('drink/index'); ?>">Index</a></li>
                                        <li class="divider"></li>
                                        <li class="dropdown-header" role="presentation">Member functions</li>
                                        <li class="disabled"><a href="<?php echo base_url('drink/fav/1'); ?>">Favourites</a></li>
                                        <li class="disabled"><a href="<?php echo base_url('drink/user/1'); ?>">My Drinks</a></li>
                                        <li class="divider"></li>
                                        <li class="dropdown-header" role="presentation">Selected Recipes</li>
                                        <li><a href="<?php echo base_url('drink/top'); ?>">Best Rated</a></li>
                                        <li><a href="<?php echo base_url('drink/staff'); ?>">Staff Choice</a></li>
                                        <li class="divider"></li>
                                        <li class="dropdown-header" role="presentation">Try something new</li>
                                        <li><a href="<?php echo base_url('drink/details/5'); ?>">Random Drink</a></li>
                                    </ul>
                                </li>
                                
                                <!-- Category dropdown -->
                                <li class="dropdown">
                                   <a href="#" class="dropdown-toggle" data-toggle="dropdown">Categories <b class="caret"></b></a>
                                   <ul class="dropdown-menu">
                                       <li><a href="<?php echo base_url('category/index'); ?>">Index</a></li>
                                       <li class="divider"></li>
                                       <li class="dropdown-header" role="presentation">Drink categories</li>
                                       <li><a href="<?php echo base_url('category/details/1'); ?>">Sour</a></li>
                                       <li><a href="<?php echo base_url('category/details/2'); ?>">Sweet</a></li>
                                       <li><a href="<?php echo base_url('category/details/3'); ?>">Tropical</a></li>
                                       <li><a href="<?php echo base_url('category/details/4'); ?>">Hard Stuff</a></li>
                                   </ul>
                               </li>
                               
                               <!-- Ingredient dropdown -->
                                <li class="dropdown">
                                   <a href="#" class="dropdown-toggle" data-toggle="dropdown">Ingredients <b class="caret"></b></a>
                                   <ul class="dropdown-menu">
                                       <li><a href="<?php echo base_url('ingredient/index'); ?>">Index</a></li>
                                       <li class="divider"></li>
                                       <li class="dropdown-header" role="presentation">Spirits</li>
                                       <li><a href="<?php echo base_url('ingredient/details/1'); ?>">Rum</a></li>
                                       <li><a href="<?php echo base_url('ingredient/details/2'); ?>">Vodka</a></li>
                                       <li><a href="<?php echo base_url('ingredient/details/3'); ?>">Tequila</a></li>
                                       <li><a href="<?php echo base_url('ingredient/details/4'); ?>">Liquors</a></li>
                                   </ul>
                               </li>
                            </ul>
                            
                            <!-- User menu -->
                            <ul class="nav navbar-nav navbar-right">
                                <!-- (logged in) -->
                                <li class="dropdown">
                                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-exclamation-sign"></span> Guest user <b class="caret"></b></a>
                                    <ul class="dropdown-menu">
                                       <li><a href="<?php echo base_url('auth/login'); ?>"><span class="glyphicon glyphicon-check"></span> Sign In</a></li>
                                       <li><a href="<?php echo base_url('auth/register'); ?>"><span class="glyphicon glyphicon-edit"></span> Create Account</a></li>
                                    </ul>
                                </li>
                                
                                <!-- (guest) -->
                                <li class="dropdown">
                                   <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                       <span class="glyphicon glyphicon-envelope"></span>
                                       Username <b class="caret"></b>
                                   </a>
                                   <ul class="dropdown-menu">
                                       <li class="dropdown-header" role="presentation">Member-Area</li>
                                       <li><a href="<?php echo base_url('user/recipes/1'); ?>"><span class="glyphicon glyphicon-book"></span> My Recipes</a></li>
                                       <li><a href="<?php echo base_url('bar/index'); ?>"><span class="glyphicon glyphicon-glass"></span> Virtual Bar</a></li>
                                       <li><a href="<?php echo base_url('drink/fav/1'); ?>"><span class="glyphicon glyphicon-star"></span> Favourites</a></li>
                                       <li><a href="<?php echo base_url('user/history/1'); ?>"><span class="glyphicon glyphicon-time"></span> History</a></li>
                                       <li class="divider"></li>
                                       <li><a href="<?php echo base_url('user/details/1/profile'); ?>"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
                                       <li><a href="<?php echo base_url('user/settings/1'); ?>"><span class="glyphicon glyphicon-cog"></span> Preferences</a></li>
                                       <li><a href="<?php echo base_url('auth/logout'); ?>"><span class="glyphicon glyphicon-off"></span> Sign Out</a></li>
                                   </ul>
                               </li>
                            </ul><!-- /.User menu -->
                            
                            <!-- Search form -->
                            <form class="navbar-form" role="search">
                                <div class="form-group">
                                  <input type="text" class="form-control" placeholder="Search">
                                </div>
                                <button type="submit" class="btn btn-default">Submit</button>
                            </form>
                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container fluid -->
                </nav>
            </div> <!-- /.header -->
            
            <!-- Sidebar -->
            <div class="col-md-2" id="sidebar">
                <?php 
                    echo $sidebar;
                ?>
               <!-- 
               <hr>
               <img class="thumbnail" id="ad-secondary" data-src="holder.js/100%x175/#000:#fff" alt="ad-secondary">
               -->
            </div><!-- /.sidebar -->
            
            <!-- Main page content -->
            <div class="col-md-10" id="content">
                <div class="container-fluid">
                    <?php
                        echo '<div class="page-header">' . heading($headline, 3, 'id="headline"') . '</div>';
                        echo $yield;
                    ?>
                </div>
            </div><!-- /.content -->
            
            <!-- Footer -->
            <div class="col-md-12" id="footer">
                <span><a href="#" class="badge">Contact</a></span>
                <span><a href="#" class="badge">About Us</a></span>
                <span><a href="#" class="badge">Donate</a></span>
            </div>
        </div><!-- /.row -->
    </div><!-- /.container -->
</body>



